import DataType from 'sequelize';
import { sequelize } from '../../sequelize';
const Interface = sequelize.define('Interface', {

  type: {
    type: new DataType.VIRTUAL(DataType.STRING),
    get() {
      return 'InterfaceType';
    },
  },

  id: {
    type: DataType.BIGINT,
    primaryKey: true,
    autoIncrement: true,
  },

  name: {
    type: DataType.STRING,
  },

  ifName: {
    type: DataType.STRING,
  },

  addrType: {
    type: DataType.INTEGER,
    defaultValue: 1,         //   0 dhcp, 1 static, 2 unmanaged
  },

  ipAddr: {
    type: DataType.STRING,
  },

  netmask: {
    type: DataType.STRING,
  },

  gateway: {
    type: DataType.STRING,
  },

  dns: {
    type: DataType.STRING,
  },

  wtp_id: {
    type: DataType.INTEGER,
  },

});

export default Interface;
